package com.biaobiaoqi.scoreanalysis.hibernate.bean;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Transient;

import com.biaobiaoqi.scoreanalysis.util.Semester;

@Entity
public class SchoolYear extends BaseBean {
	@Column(nullable=false)
	private Integer beginYear;
	@Column(nullable=false)
	private Integer endYear;
	@Column(nullable=false)
	private Semester semester;
	@OneToMany(mappedBy="schoolYear")
	private List<Examination> examinations = new ArrayList<Examination>();
	@Transient
	private String schoolYearName;
	
	public Integer getBeginYear() {
		return beginYear;
	}
	public void setBeginYear(Integer beginYear) {
		this.beginYear = beginYear;
	}
	public Integer getEndYear() {
		return endYear;
	}
	public void setEndYear(Integer endYear) {
		this.endYear = endYear;
	}
	public List<Examination> getExaminations() {
		return examinations;
	}
	public void setExaminations(List<Examination> examinations) {
		this.examinations = examinations;
	}
	public String getSchoolYearName() {
		return beginYear + "-" + endYear +"学年"+semester.getName();
	}
	public Semester getSemester() {
		return semester;
	}
	public void setSemester(Semester semester) {
		this.semester = semester;
	}
}
